Skip to content

Conversation

@Dev-iL
Copy link
Collaborator

@Dev-iL Dev-iL commented Jan 4, 2026

Context:

https://github.com/apache/airflow/actions/runs/20681629287/job/59376845610?pr=59218#step:7:1199
https://github.com/apache/airflow/actions/runs/20681629287/job/59376845598?pr=59218#step:7:4224

airflow-core/src/airflow/models/trigger.py:130: error: Incompatible types in assignment (expression has type "str | None", variable has type "SQLCoreOperations[str] | str")  [assignment]
              self.queue = queue
                           ^~~~~

airflow-core/src/airflow/models/trigger.py:487: error: Incompatible types in assignment (expression has type "float | int | dict[Any, Any] | list[Any] | str | tuple[Any, ...] | set[Any] | None",
  variable has type "SQLCoreOperations[dict[Any, Any] | None] | dict[Any, Any] | None")  [assignment]
          task_instance.next_kwargs = serialize(next_kwargs)
                                      ^~~~~~~~~~~~~~~~~~~~~~

airflow-core/src/airflow/jobs/scheduler_job_runner.py:3037: error: Unsupported operand types for >= ("int" and "None")  [operator]
              exceeds = active_non_backfill_runs >= dag_model.max_active_runs
                        ^

airflow-core/src/airflow/jobs/scheduler_job_runner.py:3037: note: Right operand is of type "int | None"
  providers/common/sql/src/airflow/providers/common/sql/hooks/sql.py:38: error: Incompatible types in assignment (expression has type "None", variable has type overloaded function)  [assignment]
          create_engine = None
                          ^~~~

providers/common/sql/src/airflow/providers/common/sql/hooks/sql.py:39: error: Incompatible types in assignment (expression has type "None", variable has type overloaded function)  [assignment]
          inspect = None
                    ^~~~

providers/common/sql/src/airflow/providers/common/sql/hooks/sql.py:40: error: Incompatible types in assignment (expression has type "None", variable has type "Callable[[str | URL], URL]")  [assignment]
          make_url = None
                     ^~~~

providers/common/sql/src/airflow/providers/common/sql/hooks/sql.py:41: error: Cannot assign to a type  [misc]
          ArgumentError = Exception
          ^~~~~~~~~~~~~

providers/common/sql/src/airflow/providers/common/sql/hooks/sql.py:41: error: Incompatible types in assignment (expression has type "type[Exception]", variable has type "type[ArgumentError]") 
  [assignment]
          ArgumentError = Exception
                          ^~~~~~~~~

providers/common/sql/src/airflow/providers/common/sql/hooks/sql.py:42: error: Cannot assign to a type  [misc]
          NoSuchModuleError = Exception
          ^~~~~~~~~~~~~~~~~

providers/common/sql/src/airflow/providers/common/sql/hooks/sql.py:42: error: Incompatible types in assignment (expression has type "type[Exception]", variable has type "type[NoSuchModuleError]") 
  [assignment]
          NoSuchModuleError = Exception
                              ^~~~~~~~~

providers/exasol/src/airflow/providers/exasol/hooks/exasol.py:31: error: Cannot assign to a type  [misc]
          URL = None
          ^~~

providers/exasol/src/airflow/providers/exasol/hooks/exasol.py:31: error: Incompatible types in assignment (expression has type "None", variable has type "type[URL]")  [assignment]
          URL = None
                ^~~~

providers/standard/tests/unit/standard/operators/test_hitl.py:263: error: Incompatible types in assignment (expression has type "UUID", variable has type "str")  [assignment]
                  expected_ti_id = UUID(ti.id)
                                   ^~~~~~~~~~~

providers/openlineage/tests/unit/openlineage/plugins/test_listener.py:211: error: Argument "dag_version_id" to "create_task_instance" has incompatible type "str | None"; expected "UUID"  [arg-type]
                      dag_version_id=dagrun.created_dag_version_id,
                                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~

providers/amazon/src/airflow/providers/amazon/aws/hooks/redshift_sql.py:30: error: Cannot assign to a type  [misc]
        URL = create_engine = None
        ^~~

providers/amazon/src/airflow/providers/amazon/aws/hooks/redshift_sql.py:30: error: Incompatible types in assignment (expression has
type "None", variable has type "type[URL]")  [assignment]
        URL = create_engine = None
        ^

providers/amazon/src/airflow/providers/amazon/aws/hooks/redshift_sql.py:30: error: Incompatible types in assignment (expression has
type "None", variable has type overloaded function)  [assignment]
        URL = create_engine = None
                              ^~~~

providers/amazon/src/airflow/providers/amazon/aws/hooks/athena_sql.py:28: error: Cannot assign to a type  [misc]
        URL = None
        ^~~

providers/amazon/src/airflow/providers/amazon/aws/hooks/athena_sql.py:28: error: Incompatible types in assignment (expression has type
"None", variable has type "type[URL]")  [assignment]
        URL = None
              ^~~~

Related: #59218, #59895


^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named {pr_number}.significant.rst or {issue_number}.significant.rst, in airflow-core/newsfragments.

@Dev-iL Dev-iL force-pushed the 2601/sqla2_mypy_assorted branch from b7f802a to b27b427 Compare January 4, 2026 09:34
@Dev-iL Dev-iL requested a review from o-nikolas as a code owner January 4, 2026 09:34
@Dev-iL
Copy link
Collaborator Author

Dev-iL commented Jan 4, 2026

cc @potiuk @Prab-27 @vincbeck

@potiuk potiuk merged commit a971bcc into apache:main Jan 4, 2026
99 checks passed
@potiuk
Copy link
Member

potiuk commented Jan 4, 2026

thanks. Yeah .. we should move to sqla2 asap to stop getting those creeping in.

@Dev-iL Dev-iL deleted the 2601/sqla2_mypy_assorted branch January 4, 2026 21:58
chirodip98 pushed a commit to chirodip98/airflow-contrib that referenced this pull request Jan 5, 2026
* SQLA2: Fix mypy violation in trigger.py

* SQLA2: fix mypy violation in scheduler_job_runner.py

* SQLA2: fix mypy violation (missing type hint) in test_hitl.py

* SQLA2: fix mypy violation in exasol

* SQLA2: fix mypy violations in the common provider's sql hook

* SQLA2: fix mypy violation in openlineage/.../test_listener.py

* SQLA2: fix mypy violations in the amazon provider

* mypy: add overload annotations to serde.serialize

This solves a mypy violation in triggerer.py
chirodip98 pushed a commit to chirodip98/airflow-contrib that referenced this pull request Jan 8, 2026
* SQLA2: Fix mypy violation in trigger.py

* SQLA2: fix mypy violation in scheduler_job_runner.py

* SQLA2: fix mypy violation (missing type hint) in test_hitl.py

* SQLA2: fix mypy violation in exasol

* SQLA2: fix mypy violations in the common provider's sql hook

* SQLA2: fix mypy violation in openlineage/.../test_listener.py

* SQLA2: fix mypy violations in the amazon provider

* mypy: add overload annotations to serde.serialize

This solves a mypy violation in triggerer.py
chirodip98 pushed a commit to chirodip98/airflow-contrib that referenced this pull request Jan 9, 2026
* SQLA2: Fix mypy violation in trigger.py

* SQLA2: fix mypy violation in scheduler_job_runner.py

* SQLA2: fix mypy violation (missing type hint) in test_hitl.py

* SQLA2: fix mypy violation in exasol

* SQLA2: fix mypy violations in the common provider's sql hook

* SQLA2: fix mypy violation in openlineage/.../test_listener.py

* SQLA2: fix mypy violations in the amazon provider

* mypy: add overload annotations to serde.serialize

This solves a mypy violation in triggerer.py
stegololz pushed a commit to stegololz/airflow that referenced this pull request Jan 9, 2026
* SQLA2: Fix mypy violation in trigger.py

* SQLA2: fix mypy violation in scheduler_job_runner.py

* SQLA2: fix mypy violation (missing type hint) in test_hitl.py

* SQLA2: fix mypy violation in exasol

* SQLA2: fix mypy violations in the common provider's sql hook

* SQLA2: fix mypy violation in openlineage/.../test_listener.py

* SQLA2: fix mypy violations in the amazon provider

* mypy: add overload annotations to serde.serialize

This solves a mypy violation in triggerer.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants